﻿@page "/Login"
@page "/ajax"


@using BlazorApp.Data
@layout LoginLayout


@inject AjaxService AjaxService

<Ajax></Ajax>

<BootstrapInput DisplayText="用户名" @bind-Value="@LoginVo.UserName" ShowLabel="true"></BootstrapInput>
<BootstrapPassword DisplayText="密码" @bind-Value="LoginVo.Password" ShowLabel="true"></BootstrapPassword>

<Button OnClick="DoLogin">登录</Button>


@code {
    public LoginVo LoginVo { get; set; } = new LoginVo();

    private async void DoLogin()
    {
        var option = new AjaxOption
            {
                Url = "/api/user/login",
                Data = LoginVo
            };

        var result = await AjaxService.InvokeAsync(option);
    }

}
